import { Random } from 'mockjs'
import moment from 'dayjs'
const repositoryId = 1
const interfaces = [
  {
    id: 1,
    name: '读取文章列表',
    method: 'GET',
    url: '/public/list',
    request: {
    },
    response: {
      'list|1-20': [
        {
          'catalog|+1': ['ask', 'discuss', 'advise', 'share'],
          title: '@ctitle',
          uid: {
            _id: '@guid',
            pic: '@image("200x100", "#50B347", "#FFF", "png", "pic")',
            name: '@cname',
            'isVip|1-7': 1
          },
          snapshot: '@image("200x200", "#894FC4", "#FFF", "png", "snapshot")',
          content: '@csentence(5,20)',
          'answer|5-80': 10,
          created: function () {
            return moment().subtract(Random.natural(1, 10), 'days').format('YYYY-MM-DD HH:mm:ss')
          }
        }
      ]
    }
  },
  {
    id: 1,
    name: '获取文章详情',
    method: 'GET',
    url: '/public/content/detail',
    request: {
    },
    response: {
      title: '@ctitle(5, 10)',
      uid: {
        _id: '@guid',
        pic: '@image("200x100", "#50B347", "#FFF", "png", "pic")',
        name: '@cname',
        'isVip|1-7': 1
      },
      content: '@cparagraph(1, 5)',
      created: function () {
        return moment().subtract(Random.natural(1, 10), 'days').format('YYYY-MM-DD HH:mm:ss')
      },
      'reads|1-200': 1
    }
  },
  {
    id: 1,
    name: '获取评论',
    method: 'GET',
    url: 'public/comments',
    request: {
    },
    response: {
      'list|1-20': [{
        title: 'ctitle(5, 20)',
        cuid: {
          _id: '@guid',
          pic: '@image("200x100", "#50B347", "#FFF", "png", "pic")',
          name: '@cname'
        },
        created: function () {
          return moment().subtract(Random.natural(1, 10), 'days').format('YYYY-MM-DD HH:mm:ss')
        },
        content: '@cparagraph(1, 3)',
        'hands|1-100': 1
      }]
    }
  },
  {
    id: 1,
    name: '获取验证码接口',
    method: 'GET',
    url: '/public/getCaptcha',
    request: {
    },
    response: {
      // eslint-disable-next-line no-useless-escape
      svg: '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"140\" height=\"38\" viewBox=\"0,0,140,38\"><path fill=\"#87b7e7\" d=\"M77.25 34.39L77.24 34.38L77.22 34.36Q73.17 34.61 72.18 32.29L72.17 32.28L72.26 32.37Q72.98 31.38 74.54 29.59L74.43 29.48L74.53 29.57Q74.93 31.50 77.94 31.61L77.92 31.59L78.02 31.70Q81.39 31.76 83.03 30.42L83.02 30.41L83.04 30.44Q84.52 28.90 84.44 26.20L84.41 26.17L84.33 26.09Q84.13 20.98 79.34 21.21L79.34 21.22L79.46 21.33Q76.66 21.50 74.90 22.75L74.81 22.66L74.54 22.54L74.31 22.39L74.38 22.46Q74.61 19.19 74.50 16.45L74.63 16.58L74.46 16.41Q74.42 13.86 74.08 10.55L74.10 10.57L74.06 10.53Q77.79 11.56 81.60 11.44L81.46 11.31L81.60 11.45Q85.44 11.40 89.02 10.15L88.96 10.08L88.29 11.51L88.40 11.62Q88.01 12.29 87.82 13.13L87.84 13.15L87.83 13.14Q84.72 14.18 80.84 14.18L80.79 14.14L80.87 14.21Q79.41 14.20 77.92 14.05L77.96 14.08L78.02 14.14Q77.86 14.75 77.52 19.20L77.47 19.16L77.43 19.11Q78.35 18.74 80.41 18.59L80.38 18.56L80.49 18.67Q84.14 18.81 85.58 20.49L85.52 20.43L85.63 20.53Q86.98 22.04 87.25 25.88L87.13 25.77L87.15 25.79Q87.57 30.13 86.36 32.15L86.26 32.05L86.20 31.99Q84.26 33.98 80.95 34.20L80.90 34.16L80.89 34.15Q79.95 34.27 77.29 34.43ZM83.36 36.73L83.21 36.58L83.26 36.63Q86.68 36.70 88.58 35.60L88.72 35.73L88.62 35.63Q89.67 34.17 89.67 32.08L89.57 31.98L89.62 32.02Q89.64 28.97 88.69 24.85L88.65 24.81L88.75 24.91Q88.20 22.99 86.98 21.58L87.01 21.61L87.09 21.73L86.86 21.43L86.62 21.34L86.49 21.21Q86.23 20.52 85.58 19.84L85.64 19.90L85.64 19.94L85.59 19.89Q84.04 18.18 80.35 18.18L80.34 18.18L80.16 18.26L80.14 18.24Q80.26 17.71 80.45 16.61L80.38 16.54L80.31 16.47Q85.36 16.65 89.40 15.02L89.49 15.10L89.36 14.98Q89.78 13.57 90.73 10.75L90.82 10.84L88.72 11.78L88.67 11.73Q88.95 10.49 89.44 9.35L89.60 9.51L89.49 9.40Q85.61 10.81 81.50 10.89L81.50 10.89L81.64 11.03Q77.53 11.14 73.57 10.04L73.56 10.03L73.61 10.07Q74.22 14.42 74.22 18.83L74.11 18.72L74.23 18.84Q74.19 20.70 74.07 22.61L74.17 22.70L74.03 22.57Q74.34 22.80 74.91 23.11L74.95 23.14L74.86 23.05Q75.27 22.89 75.92 22.55L75.92 22.55L75.84 22.47Q75.79 23.22 75.56 24.74L75.69 24.87L75.73 24.91Q76.03 24.98 76.45 25.21L76.38 25.14L76.56 25.33Q79.24 23.47 81.10 23.47L81.05 23.42L81.10 23.47Q82.46 23.50 83.65 24.15L83.56 24.06L83.72 24.22Q83.89 25.08 83.93 26.03L84.10 26.20L84.05 26.16Q84.00 28.61 82.97 29.71L83.09 29.83L82.97 29.72Q81.71 31.05 79.47 31.27L79.54 31.35L79.55 31.36Q78.57 31.41 77.89 31.33L77.79 31.24L77.86 31.31Q77.02 31.19 76.26 30.85L76.13 30.72L76.14 30.54L76.01 30.64L76.02 30.64Q75.34 30.27 74.81 28.94L74.64 28.77L74.77 28.90Q73.36 30.23 71.69 32.37L71.77 32.45L71.64 32.31Q71.96 32.98 72.80 33.93L72.95 34.08L72.80 33.94Q73.96 35.85 76.77 36.35L76.69 36.26L76.75 36.32Q77.86 36.48 83.23 36.60Z\"/><path fill=\"#5d7ddf\" d=\"M115.43 31.93L115.50 32.00L115.33 31.83Q115.68 32.86 116.21 34.88L116.19 34.86L116.14 34.81Q112.12 33.68 107.51 33.95L107.42 33.86L107.45 33.88Q102.88 34.15 98.88 36.13L98.91 36.16L98.87 36.11Q99.07 35.41 99.11 35.48L99.20 35.57L99.11 35.48Q102.92 31.60 106.84 27.18L106.77 27.12L106.72 27.06Q111.14 22.08 112.32 17.40L112.30 17.38L112.40 17.48Q112.90 15.77 111.63 14.59L111.55 14.52L111.55 14.51Q110.28 13.34 108.49 13.50L108.48 13.48L108.56 13.57Q108.06 13.36 107.71 13.36L107.80 13.45L107.85 13.49Q106.35 13.52 105.09 14.43L104.97 14.31L104.96 14.30Q103.78 15.79 104.01 18.45L103.92 18.36L103.95 18.39Q102.12 18.01 100.90 17.55L100.86 17.51L100.98 17.63Q100.66 16.10 100.59 14.65L100.73 14.79L100.65 14.71Q100.67 13.17 101.28 12.03L101.30 12.05L101.12 11.87Q102.96 10.55 106.31 10.55L106.32 10.56L108.10 10.59L108.03 10.52Q110.30 10.55 111.25 10.66L111.28 10.68L111.39 10.80Q115.71 11.20 115.98 13.63L115.88 13.54L115.98 13.63Q116.08 14.23 116.00 15.02L115.93 14.96L115.92 14.95Q115.99 15.70 115.84 16.39L115.81 16.36L115.66 16.20Q114.15 24.45 106.58 31.30L106.45 31.17L106.58 31.31Q108.00 31.16 109.37 31.16L109.34 31.13L109.34 31.13Q112.60 31.15 115.45 31.95ZM114.75 11.00L114.93 11.18L114.93 11.17Q113.31 10.51 111.59 10.43L111.54 10.38L108.04 10.11L108.06 10.13Q103.57 9.83 101.36 10.93L101.45 11.02L101.52 11.09Q100.41 12.41 100.41 14.47L100.32 14.38L100.42 14.49Q100.40 15.15 100.70 17.97L100.62 17.88L100.79 18.06Q101.18 18.13 102.36 18.44L102.37 18.45L102.52 19.63L102.35 19.46Q102.44 20.05 102.52 20.58L102.52 20.58L102.56 20.62Q103.64 20.56 106.11 20.79L106.22 20.90L106.13 20.80Q106.15 20.48 106.15 20.14L106.21 20.20L106.11 20.09Q106.16 18.32 107.38 16.97L107.42 17.01L107.31 16.90Q108.67 15.69 110.46 15.81L110.46 15.80L110.38 15.72Q111.10 15.72 111.86 15.87L111.96 15.97L111.88 15.89Q112.02 16.30 112.10 16.72L112.11 16.73L112.12 16.74Q112.15 17.16 112.08 17.50L112.14 17.56L111.98 17.40Q110.76 22.20 106.34 27.03L106.45 27.14L106.34 27.03Q104.34 29.40 98.89 35.46L98.84 35.40L98.81 35.38Q98.53 36.12 98.18 36.69L98.34 36.84L98.27 36.77Q99.86 35.89 101.39 35.36L101.46 35.44L101.49 35.46Q100.68 35.95 99.73 37.44L99.77 37.48L99.67 37.37Q99.68 37.84 99.56 38.18L99.54 38.16L99.51 38.13Q104.37 36.06 109.85 36.25L109.78 36.17L109.81 36.21Q115.50 36.38 120.07 38.74L120.18 38.84L119.15 36.68L119.09 36.61Q118.47 35.31 118.20 34.51L118.25 34.56L118.15 34.46Q117.54 34.15 116.32 33.73L116.34 33.76L116.23 33.64Q116.16 33.00 115.78 31.63L115.62 31.48L115.76 31.62Q113.47 30.96 111.19 30.77L111.14 30.73L111.24 30.82Q115.89 26.22 117.41 17.96L117.42 17.96L117.57 15.03L117.66 15.12Q117.61 13.37 116.40 12.68L116.33 12.61L116.20 12.53L116.33 12.65Q116.17 12.46 116.10 12.46L116.13 12.49L116.26 12.62Q115.86 11.61 114.76 11.00Z\"/><path fill=\"#d65656\" d=\"M56.79 35.28L56.82 35.32L53.66 35.01L53.84 35.19Q51.40 35.03 50.60 34.92L50.58 34.90L50.61 34.93Q48.70 34.51 47.52 33.63L47.48 33.59L47.51 33.62Q46.29 32.28 46.06 28.93L46.11 28.98L45.93 28.80Q45.96 28.37 45.88 27.15L45.91 27.18L45.90 27.18Q45.98 26.83 45.90 25.73L45.83 25.65L45.92 25.75Q45.77 24.79 45.81 24.07L45.88 24.15L45.93 24.20Q45.95 22.09 46.98 21.33L46.99 21.34L47.04 21.39Q49.05 20.32 53.89 20.09L53.89 20.09L53.73 19.93Q55.91 19.98 56.71 19.98L56.74 20.00L56.71 19.98Q58.11 19.90 59.48 20.20L59.45 20.16L59.44 20.16Q58.96 21.50 58.43 23.33L58.47 23.37L58.30 23.20Q57.98 23.45 57.48 23.41L57.42 23.35L57.40 23.33Q57.34 23.35 56.81 23.23L56.72 23.15L55.82 22.97L55.77 22.92Q54.72 22.67 54.11 22.71L54.18 22.78L54.05 22.65Q49.32 22.71 48.71 25.53L48.77 25.59L48.74 25.56Q48.47 26.70 48.55 27.65L48.70 27.80L48.60 27.71Q48.67 30.21 49.91 31.30L49.97 31.36L50.04 31.43Q51.33 32.57 53.92 32.60L53.78 32.46L53.78 32.46Q55.38 32.62 56.11 32.32L56.13 32.34L57.01 31.69L57.12 31.81Q57.58 31.51 58.15 31.43L58.22 31.50L58.20 31.48Q58.31 33.15 58.69 34.44L58.68 34.44L58.71 34.46Q58.63 34.99 56.84 35.34ZM60.03 38.22L59.94 38.13L60.05 38.24Q60.32 38.16 61.15 38.24L61.13 38.22L61.26 38.34Q61.81 38.29 62.15 37.72L62.17 37.73L62.27 37.83Q61.08 35.76 60.58 33.67L60.43 33.52L60.43 33.52Q60.21 33.60 59.75 33.60L59.69 33.54L59.71 33.56Q59.37 33.64 58.99 33.83L58.91 33.75L58.93 33.77Q58.48 32.41 58.33 31.00L58.33 31.00L58.45 31.12Q57.78 30.98 56.56 31.55L56.49 31.48L56.58 31.57Q55.44 32.22 54.94 32.22L54.78 32.06L54.88 32.16Q54.40 32.17 53.79 32.13L53.81 32.16L53.85 32.19Q52.94 32.16 50.96 31.59L50.87 31.49L50.80 31.43Q50.61 30.86 50.65 29.72L50.59 29.65L50.59 29.65Q50.79 25.44 55.74 24.91L55.64 24.80L55.68 24.85Q56.33 24.81 57.70 25.15L57.85 25.31L57.77 25.23Q59.10 25.53 59.82 25.49L59.79 25.45L59.88 25.55Q60.21 23.21 60.89 21.38L61.01 21.49L61.08 21.57Q60.68 21.44 60.30 21.36L60.32 21.38L59.55 21.29L59.44 21.19Q59.65 20.71 60.03 19.84L60.08 19.88L59.95 19.75Q58.45 19.43 56.89 19.43L56.94 19.49L57.02 19.56Q54.65 19.59 50.27 19.97L50.12 19.82L50.19 19.90Q48.16 19.95 46.60 20.94L46.60 20.95L46.70 21.05Q45.48 22.00 45.48 23.90L45.48 23.90L45.49 23.91Q45.43 24.27 45.54 25.49L45.49 25.43L45.57 25.51Q45.57 26.47 45.53 27.07L45.51 27.05L45.64 27.18Q45.57 28.97 46.29 32.70L46.37 32.78L46.40 32.81Q46.74 33.61 47.24 34.11L47.20 34.07L47.46 34.33L47.59 34.42L47.55 34.38Q48.51 36.44 52.43 37.05L52.44 37.06L52.37 36.99Q55.65 37.61 58.31 37.88L58.34 37.90L58.29 37.85Q59.13 37.97 60.05 38.24Z\"/><path fill=\"#50dc96\" d=\"M24.67 23.17L24.64 23.14L24.58 23.08Q22.86 23.08 21.63 24.50L21.58 24.46L21.64 24.52Q20.39 25.93 20.20 27.83L20.06 27.69L20.16 27.79Q19.99 29.91 21.07 30.88L20.98 30.79L20.90 30.70Q22.14 31.84 24.24 31.72L24.22 31.71L24.08 31.57Q26.22 31.46 27.32 30.77L27.42 30.87L27.26 30.71Q28.58 29.79 28.58 28.22L28.45 28.09L28.58 28.22Q28.44 27.70 28.36 27.32L28.44 27.39L28.33 27.28Q28.52 25.72 27.41 24.37L27.43 24.39L27.33 24.29Q26.25 22.96 24.57 23.07ZM24.14 34.18L24.29 34.32L24.15 34.18Q19.76 34.17 18.35 33.41L18.34 33.40L18.36 33.42Q17.46 32.78 17.27 31.07L17.23 31.04L17.12 30.92Q17.20 30.36 17.24 29.63L17.22 29.61L17.11 29.51Q17.38 28.67 17.38 28.21L17.28 28.11L17.31 28.15Q17.85 25.38 18.01 24.69L17.86 24.54L17.84 24.52Q18.29 22.58 19.13 21.17L19.11 21.15L19.25 21.29Q21.89 16.89 27.83 10.53L27.89 10.59L27.76 10.46Q30.47 10.20 32.68 9.40L32.59 9.31L32.67 9.39Q25.91 16.95 22.72 21.18L22.69 21.15L22.65 21.11Q23.61 20.59 24.91 20.59L24.97 20.66L24.85 20.53Q28.27 20.64 29.79 22.58L29.79 22.58L29.78 22.57Q31.02 24.11 31.36 27.65L31.44 27.73L31.34 27.63Q31.53 28.47 31.53 29.08L31.58 29.13L31.57 29.12Q31.50 32.17 29.29 33.23L29.38 33.33L29.33 33.28Q28.06 33.83 24.18 34.21ZM26.55 36.70L26.49 36.64L26.58 36.73Q27.84 36.66 29.82 36.73L29.76 36.67L29.84 36.75Q31.42 36.77 32.98 36.05L33.02 36.09L32.98 36.05Q34.13 35.30 34.13 33.51L34.00 33.37L34.03 33.41Q34.05 32.93 33.88 31.94L33.87 31.93L33.86 31.93Q33.77 31.02 33.77 30.56L33.63 30.42L33.74 30.52Q32.87 25.81 31.27 23.91L31.20 23.84L31.23 23.87Q31.17 23.77 31.02 23.54L31.10 23.62L30.61 23.21L30.68 23.32L30.55 23.19Q30.35 22.84 29.75 21.89L29.65 21.80L29.75 21.89Q28.81 20.92 26.83 20.46L26.83 20.46L26.81 20.44Q27.96 18.77 30.93 15.08L30.88 15.03L35.19 9.82L35.20 9.83Q33.58 10.64 31.18 11.40L31.26 11.48L31.30 11.52Q32.17 10.49 33.96 8.51L34.02 8.58L34.00 8.55Q31.54 9.55 27.65 10.13L27.65 10.12L27.56 10.03Q22.05 16.13 19.08 21.08L18.91 20.91L19.06 21.06Q17.47 23.50 16.89 29.75L16.91 29.76L16.82 29.67Q16.77 30.27 16.85 31.22L16.90 31.28L16.87 31.24Q16.95 33.00 18.06 33.92L18.15 34.01L18.13 33.99Q18.40 34.04 18.37 34.07L18.43 34.14L18.32 34.02Q18.69 34.93 19.49 35.35L19.61 35.47L19.61 35.47Q21.00 36.09 22.94 36.28L22.92 36.27L23.05 36.40Q22.95 36.30 26.45 36.60ZM26.15 25.30L26.34 25.49L26.28 25.42Q26.89 25.35 27.84 25.85L27.85 25.86L27.84 25.84Q28.11 26.73 28.11 27.38L28.08 27.34L28.11 27.37Q28.38 29.32 27.43 30.31L27.42 30.30L27.34 30.22Q26.38 31.04 24.28 31.35L24.24 31.31L24.19 31.25Q22.84 31.35 22.31 31.09L22.28 31.06L22.23 31.01Q22.11 30.62 22.11 30.32L22.11 30.32L22.12 30.33Q21.76 26.92 24.69 25.63L24.67 25.61L24.72 25.66Q25.41 25.25 26.17 25.32Z\"/></svg>'
    }
  },
  {
    id: 1,
    name: '找回密码接口',
    method: 'POST',
    url: '/login/forget',
    request: {
    },
    response: {
    }
  },
  {
    id: 1,
    name: '登录接口',
    method: 'POST',
    url: '/login/login',
    request: {
    },
    response: {
    }
  },
  {
    id: 1,
    name: '用户注册信息',
    method: 'POST',
    url: '/login/reg',
    request: {
    },
    response: {
    }
  },
  {
    id: 1,
    name: '重置密码接口',
    method: 'POST',
    url: '/login/reset',
    request: {
    },
    response: {
    }
  },
  {
    id: 1,
    name: '用户签到',
    method: 'GET',
    url: '/user/fav',
    request: {
    },
    response: {
    }
  },
  {
    id: 2,
    name: '更新用户基本资料',
    method: 'POST',
    url: '/user/basic',
    request: {
    },
    response: {
    }
  },
  {
    id: 3,
    name: '确认修改用户名',
    method: 'GET',
    url: '/public/resetEmail',
    request: {
    },
    response: {
    }
  },
  {
    id: 4,
    name: '修改用户密码',
    method: 'POST',
    url: '/user/changePassword',
    request: {
    },
    response: {
    }
  },
  {
    id: 5,
    name: '修改用户密码',
    method: 'POST',
    url: '/user/changePassword',
    request: {
    },
    response: {
    }
  },
  {
    id: 6,
    name: '修改用户密码',
    method: 'POST',
    url: '/user/changePassword',
    request: {
    },
    response: {
    }
  },
  {
    id: 7,
    name: '设置收藏 & 取消收藏',
    method: 'GET',
    url: '/user/setCollect',
    request: {
    },
    response: {
    }
  },
  {
    id: 8,
    name: '获取收藏列表',
    method: 'GET',
    url: '/user/collect',
    request: {
    },
    response: {
    }
  },
  {
    id: 9,
    name: '获取发表的文章列表',
    method: 'GET',
    url: '/user/POST',
    request: {
    },
    response: {
    }
  },
  {
    id: 10,
    name: '获取用户最近的发表文章列表',
    method: 'GET',
    url: '/public/latestPOST',
    request: {
    },
    response: {
    }
  },
  {
    id: 11,
    name: '删除指定文章列表',
    method: 'GET',
    url: '/user/deletePOST',
    request: {
    },
    response: {
    }
  },
  {
    id: 12,
    name: '获取用户的基本信息',
    method: 'GET',
    url: '/public/info',
    request: {
    },
    response: {
    }
  },
  {
    id: 13,
    name: '获取用户最近评论列表',
    method: 'GET',
    url: '/public/latestComment',
    request: {
    },
    response: {
    }
  },
  {
    id: 14,
    name: '获取用户未读消息',
    method: 'GET',
    url: '/user/getmsg',
    request: {
    },
    response: {
    }
  },
  {
    id: 15,
    name: '获取用户已读消息',
    method: 'GET',
    url: '/user/getHands',
    request: {
    },
    response: {
    }
  },
  {
    id: 16,
    name: '设置用户未读消息',
    method: 'POST',
    url: '/user/setmsg',
    request: {
    },
    response: {
    }
  }
]
const RAP = window.RAP || {
  protocol: 'http',
  host: '172.16.35.88:8080',
  interfaces: {}
}
RAP.interfaces[repositoryId] = interfaces

export default RAP
